home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / ietf / urn / urn-archives / urn-ietf.archive.9701 / 000005_owner-urn-ietf _Thu Jan 9 13:00:35 1997.msg < prev    next >
Internet Message Format  |  1997-02-19  |  18KB

  1. Received: (from daemon@localhost) by services.bunyip.com (8.6.10/8.6.9) id NAA23964 for urn-ietf-out; Thu, 9 Jan 1997 13:00:35 -0500
  2. Received: from mocha.bunyip.com (mocha.Bunyip.Com [192.197.208.1]) by services.bunyip.com (8.6.10/8.6.9) with SMTP id NAA23959 for <urn-ietf@services.bunyip.com>; Thu, 9 Jan 1997 13:00:30 -0500
  3. Received: from acl.lanl.gov by mocha.bunyip.com with SMTP (5.65a/IDA-1.4.2b/CC-Guru-2b)
  4.         id AA03878  (mail destined for urn-ietf@services.bunyip.com); Thu, 9 Jan 97 13:00:26 -0500
  5. Received: from magenta.acl.lanl.gov (magenta.acl.lanl.gov [128.165.147.153]) by acl.lanl.gov (8.7.3/8.7.3) with ESMTP id LAA01187 for <urn-ietf@bunyip.com>; Thu, 9 Jan 1997 11:00:24 -0700 (MST)
  6. From: "Ronald E. Daniel" <rdaniel@acl.lanl.gov>
  7. Received: (rdaniel@localhost) by magenta.acl.lanl.gov (8.7.5/8.6.4) id LAA01285 for urn-ietf@bunyip.com; Thu, 9 Jan 1997 11:00:24 -0700 (MST)
  8. Date: Thu, 9 Jan 1997 11:00:24 -0700 (MST)
  9. Message-Id: <199701091800.LAA01285@magenta.acl.lanl.gov>
  10. To: urn-ietf@bunyip.com
  11. Subject: [URN] new HTTP conventions draft
  12. Sender: owner-urn-ietf@services.bunyip.com
  13. Precedence: bulk
  14. Reply-To: "Ronald E. Daniel" <rdaniel@acl.lanl.gov>
  15. Errors-To: owner-urn-ietf@bunyip.com
  16.  
  17. INTERNET DRAFT                                                  Ron Daniel
  18. draft-ietf-urn-http-conv-01.txt             Los Alamos National Laboratory
  19.                                                                9 Jan, 1997
  20.  
  21.  
  22.              Conventions for the Use of HTTP for URN Resolution
  23.  
  24.  
  25. Status of this Memo
  26. ===================
  27.  
  28.     This document is an Internet-Draft.  Internet-Drafts are working
  29.     documents of the Internet Engineering Task Force (IETF), its
  30.     areas, and its working groups.  Note that other groups may also
  31.     distribute working documents as Internet-Drafts.
  32.   
  33.     Internet-Drafts are draft documents valid for a maximum of six
  34.     months and may be updated, replaced, or obsoleted by other
  35.     documents at any time.  It is inappropriate to use Internet-
  36.     Drafts as reference material or to cite them other than as
  37.     ``work in progress.''
  38.   
  39.     To learn the current status of any Internet-Draft, please check
  40.     the ``1id-abstracts.txt'' listing contained in the Internet-
  41.     Drafts Shadow Directories on ftp.is.co.za (Africa),
  42.     nic.nordu.net (Europe), munnari.oz.au (Pacific Rim),
  43.     ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast).
  44.  
  45.     This draft expires 21 July, 1997.
  46.   
  47.   
  48.  
  49. Abstract:
  50. =========
  51.  
  52. The URN-WG was formed to specify persistent, location-independent names
  53. for network accessible resources, as well as resolution mechanisms to retrive
  54. the resources given such a name. At this time the URN-WG is considering
  55. one particular resolution mechanism, the NAPTR proposal [1]. That proposal
  56. specifies how a client may find a "resolver" for a URN, when the URN
  57. does not contain a domain name for that resolver. A resolver is a database
  58. that can tell the client where the resource is, can provide information (such
  59. as a bibliographic citation) on the resource, or may even be able to provide
  60. the resource itself to the client. While the NAPTR draft specifies how to
  61. locate a resolver, it does not specify how the client should speak to the
  62. resolver. Instead, the NAPTR draft provides a field that can be used to
  63. specify the "resolution protocol" the client may use to speak to the
  64. resolver.
  65.  
  66. This draft establishes conventions for using HTTP as one such resolution
  67. protocol. It specifies how to encode URN resolution requests and responses
  68. in HTTP 1.0 (and 1.1) requests and responses. Once a client has used
  69. NAPTR records to locate a resolver that speaks the "http" resolution
  70. protocol, these are the conventions it must follow. The primary goal of
  71. this draft is to define a convention that is simple to implement
  72. and will allow existing HTTP servers to easily add support for URN
  73. resolution. We expect that the resolution databases that arise will be
  74. useful when more sophisticated resolution protocols are developed later.
  75.  
  76.  
  77. 1.0  Introduction:
  78. ==================
  79.  
  80. The NAPTR draft[1] describes a way of using DNS to locate resolvers for
  81. URIs.  That draft provides the services field to specify the "resolution
  82. protocol" spoken by the resolver, as well as the "resolution services"
  83. it offers. As of this writing, the "resolution protocols" allowed by the
  84. NAPTR draft are HTTP, RCDS, HDL, and RWHOIS. (That list is expected to grow
  85. over time). The NAPTR draft also lists a variety of resolution services,
  86. such as N2L (given a URN, return a URL); N2R (Given a URN, return the
  87. named resource), etc. This draft specifies the conventions to follow to
  88. encode resolution service requests in the HTTP protocol, allowing
  89. widely available HTTP daemons to serve as URN resolvers. This is the
  90. specification to follow when the services field ina NAPTR record
  91. begins with "http".
  92.  
  93. The reader is assumed to be familiar with the HTTP/1.0 [2] and 1.1 [3]
  94. specifications. Implementors of this specification should be familiar with
  95. CGI scripts for database lookups.
  96.  
  97.  
  98. 2.0 General Approach:
  99. =====================
  100.  
  101. The general approach used to encode resolution service requests in HTTP
  102. is quite simple: 
  103.  
  104.     GET /uri-res/<service>/<uri>  HTTP/1.0
  105.  
  106. For example, if we have the URN "urn:cid:foo@huh.com" and want a URL,
  107. we would send the request:
  108.  
  109.     GET /uri-res/N2L/urn:cid:foo@huh.com HTTP/1.0
  110.  
  111. Because of the character set limitations on URIs, we might wish to
  112. encode the '@' character as its hex equivalent, thus the request would be
  113.  
  114.     GET /uri-res/N2L/urn:cid:foo%40huh.com HTTP/1.0
  115.  
  116. The request could also be encoded as an HTTP 1.1 request. This would look
  117. like:
  118.  
  119.     GET /uri-res/N2L/urn:cid:foo%40huh.com HTTP/1.1
  120.     Host: <whatever host we are sending the request to>
  121.  
  122. Handling these requests on the server side is easy to implement in a
  123. number of ways. The N2L request could be handled by a CGI script that
  124. took the incoming URN, looked it up in a database, and returned the URL
  125. as an HTTP redirect. Service requests like N2R or N2C could be set up
  126. so that the daemon answered the request by returning files out of N2R/
  127. and N2C/ directories, or they could also be handled by a script that
  128. accessed a database of information.
  129.  
  130. One caveat should be kept in mind. The URN syntax draft[4] discusses
  131. the notion of lexical equivalance. This means that two URIs are equivalent
  132. under certain conditions of case-insensitivity and/or %encoding of characters.
  133. Resolvers MUST return identical results for all lexically equivalent encodings
  134. of a URI. For example, the requests below must return identical results:
  135.     GET /uri-res/N2L/urn:cid:foo@huh.com HTTP/1.0
  136.     GET /uri-res/N2L/URN:CID:foo@huh.com HTTP/1.0
  137.     GET /uri-res/N2L/urn:cid:foo%40huh%2ecom HTTP/1.0
  138.  
  139. Responses from the HTTP server follow standard HTTP practice. Status
  140. codes, such as 200 (OK) or 404 (Not Found) shall be returned.
  141. The normal rules for determining cachability, negotiating formats, etc.
  142. apply.
  143.  
  144.  
  145. 3.0 Service-specific details:
  146. =============================
  147.  
  148. This section goes through the various resolution services established
  149. in the URN services draft[5] and states how to encode each of them,
  150. how the results should be returned, and any special status codes that
  151. are likely to arise.
  152.  
  153. Unless stated otherwise, the HTTP requests are formed according to
  154. the simple convention above, either for HTTP/1.0 or HTTP/1.1. The response
  155. is assumed to be an entity with normal headers and body unless stated
  156. otherwise. (N2L is the only request that need not return a body).
  157.  
  158.  
  159. 3.1  N2L (URN to URL):
  160. ----------------------
  161.  
  162. The request is encoded as above. The URL MUST be returned in a Location:
  163. header for the convienience of the user in the most common case of wanting
  164. the resource. If the lookup is successful, a 30X status line SHOULD be
  165. returned. HTTP/1.1 clients should be sent the 303 status code. HTTP/1.0
  166. clients should be sent the 302 (Moved temporarily) status code unless the
  167. resolver has particular resons for using 301 (moved permanently) or 304
  168. (not modified) codes.
  169.  
  170. Note that access controls may be applied to this, or any other, resolution
  171. service request. Therefore the 401 (unauthorized) and 403 (forbidden)
  172. status codes are legal responses. The server may wish to provide a body
  173. in the response to explain the reason for refusing access, and/or to provide
  174. alternate information about the resource, such as the price it will cost
  175. to obtain the resource's URL.
  176.  
  177. 3.2  N2Ls (URN to URLs):
  178. ------------------------
  179.  
  180. The request is encoded as above. The result is a list of 0 or
  181. more URLs. The Internet Media Type (aka ContentType) of the result
  182. may be negotiated using standard HTTP mechanisms if desired. At a
  183. minimum the resolver should support the text/uri-list media type.
  184. (See Appendix A for the definition of this media type). That media
  185. type is suitable for machine-processing of the list of URLs. Resolvers
  186. may also return the results as text/html, text/plain, or any other
  187. media type they deem suitable.
  188.  
  189. No matter what the particular media type, the result MUST be a list
  190. of the URLs which may be used to obtain an instance of the resource
  191. identified by the URN. All URIs shall be encoded according to the
  192. URI specification [6].
  193.  
  194. If the client has requested the result be returned as text/html or
  195. application/html, the result should be encoded as:
  196. <UL>
  197. <LI><A HREF="...url 1...">...url 1...</A>
  198. <LI><A HREF="...url 2...">...url 2...</A>
  199.  etc.
  200. </UL>
  201. where the strings ...url n... are replaced by the n'th URL in the list.
  202.  
  203.  
  204. 3.3  N2R (URN to Resource):
  205. ---------------------------
  206.  
  207. The request is encoded as above. The resource is returned using
  208. standard HTTP mechanisms. The request may be modified using the
  209. Accept: header as in normal HTTP to specify that the result
  210. be given in a preferred Internet Media Type.
  211.  
  212.  
  213. 3.4  N2Rs (URN to Resources):
  214. -----------------------------
  215.  
  216. This resolution service returns multiple instances of a resource,
  217. for example, GIF and JPEG versions of an image. The judgment about
  218. the resources being "the same" resides with the naming authority that
  219. issued the URN.
  220.  
  221. The request is encoded as above. The result shall be a MIME
  222. multipart/alternative message with the alternative versions of the
  223. resource in seperate body parts. If there is only one version of
  224. the resource identified by the URN, it MAY be returned without the
  225. multipart/alternative wrapper. Resolver software SHOULD look at the
  226. Accept: header, if any, and only return versions of the resource
  227. that are acceptable according to that header. 
  228.  
  229.  
  230. 3.5  N2C (URN to URC):
  231. ----------------------
  232.  
  233. URCs (Uniform Resource Characteristics) are descriptions of other
  234. resources. This request allows us to obtain a description of the
  235. resource identified by a URN, as opposed to the resource itself.
  236. The description might be a bibliographic citation, a digital signature,
  237. a revision history, etc. This draft does not specify the content of
  238. any response to a URC request. That content is expected to vary from
  239. one resolver to another.
  240.  
  241. The format of any response to a N2C request MUST be communicated using the
  242. ContentType header, as is standard HTTP practice. The Accept: header
  243. SHOULD be honored.
  244.  
  245.  
  246. 3.6  N2Ns (URN to URNs):
  247. ------------------------
  248.  
  249. While URNs are supposed to identify one and only one resource, that
  250. does not mean that a resource may have one and only one URN. For
  251. example, consider a resource that has something like
  252. "current-weather-map" for one URN and "weather-map-for-datetime-x" for
  253. another URN. The N2Ns service request lets us obtain lists of URNs that
  254. are believed equivalent at the time of the request. As the weathermap
  255. example shows, some of the equivalances will be transitory, so the
  256. standard HTTP mechanisms for communicating cachability MUST be honored.
  257.  
  258. The request is encoded as above. The result is a list of all the
  259. URNs, known to the resolver, which identify the same resource as the
  260. input URN. The result shall be encoded as for the N2Ls request
  261. above (text/uri-list unless specified otherwise by an Accept: header).
  262.  
  263. 3.7  L2Ns (URL to URNs):
  264. ----------------------
  265.  
  266. The request is encoded as above. The response is a list of any URNs
  267. known to be assigned to the resource at the given URL. The result
  268. shall be encoded as for the N2Ls and N2Ns requests.
  269.  
  270.  
  271. 3.8  L2Ls (URL to URLs):
  272. ------------------------
  273.  
  274. The request is encoded as described above. The result is a list of
  275. all the URLs that the resolver knows are associated with the resource
  276. located by the given URL. This is encoded as for the N2Ls, N2Ns, and L2Ns
  277. requests.
  278.  
  279.  
  280. 3.9  L2C (URL to URC):
  281. ----------------------
  282.  
  283. The request is encoded as above, the response is the same as for the
  284. N2C request.
  285.  
  286.  
  287. Appendix A: The text/uri-list Internet Media Type
  288. =================================================
  289. [This appendix will be augmented or replaced by the registration
  290. of the text/uri-list IMT once that registration has been performed].
  291.  
  292. Several of the resolution service requests, such as N2Ls, N2Ns, L2Ns,
  293. L2Ls, result in a list of URIs being returned to the client. The
  294. text/uri-list Internet Media Type is defined to provide a simple format
  295. for the automatic processing of such lists of URIs.
  296.  
  297. The format of text/uri-list resources is:
  298. 1) Any lines beginning with the '#' character are comment lines
  299.    and are ignored during processing. (Note that '#' is a character
  300.    that may appear in URIs, so it only denotes a comment when it is the
  301.    first character on a line).
  302. 2) The remaining non-comment lines MUST be URIs (URNs or URLs), encoded
  303.    according to the URI specification RFC[6]. Each URI shall appear on
  304.    one and only one line.
  305. 3) As for all text/* formats, lines are terminated with a CR LF pair.
  306.  
  307. In applications where one URI has been mapped to a list of URIs, such
  308. as in response to the N2Ls request, the first line of the text/uri-list
  309. response SHOULD be a comment giving the original URI. 
  310.  
  311. An example of such a result for the N2L request is shown below in figure 1.
  312.  
  313.      # urn:cid:foo@huh.org
  314.      http://www.huh.org/cid/foo.html
  315.      http://www.huh.org/cid/foo.pdf
  316.      ftp://ftp.foo.org/cid/foo.txt
  317.  
  318.                Figure 1: Example of the text/uri-list format
  319.  
  320.  
  321. Appendix B:  n2l.pl script
  322. ==========================
  323.  
  324. This is a simple CGI script for the N2L resolution service. It
  325. assumes the presence of a DBM database to store the URN to URL
  326. mappings. This script does not specify standard behavior, it is
  327. provided merely as a courtesy for implementors. In fact, this
  328. script does not process incoming Accept: headers, nor does it
  329. generate status codes. Such behavior should be part of a real
  330. script for any of the resolution services.
  331.  
  332.  
  333.     #!/bin/perl
  334.     # N2L  - performs urn to url  resolution 
  335.  
  336.     $n2l_File = "...filename for DBM database...";
  337.  
  338.  
  339.     $urn = $ENV{'PATH_INFO'} ;
  340.     if(length($urn)<3)
  341.     {
  342.         $error=1;
  343.     }
  344.  
  345.     if(!$error)
  346.     {
  347.         $urn =~s/^(\/)(urn:)?(.*)/$3/i;
  348.         # Additional operations should be performed here
  349.         # to convert lexically equivalent versions of a URI into
  350.         # a canonical version for DB lookups.
  351.  
  352.         dbmopen(%lu,$n2l_File,0444);
  353.         if($lu{$urn})
  354.         {
  355.         $url=$lu{$urn};
  356.         print STDOUT "Location: $url\n\n";
  357.         }else{
  358.         $error=2;
  359.         }
  360.         dbmclose(%lu);
  361.     }
  362.  
  363.     if($error)
  364.     {
  365.         print "Content-Type: text/html \n\n";
  366.         print "<html>\n";
  367.         print "<head><title>URN Resolution: N2L</title></head>\n";
  368.         print "<BODY>\n";
  369.         print "<h1>URN to URL resolution failed for the URN:</h1>\n";
  370.         print "<hr><h3>$urn</h3>\n";
  371.         print "</body>\n";
  372.         print "</html>\n";
  373.     }
  374.  
  375.     exit;
  376.  
  377.  
  378. References:
  379. ===========
  380.  
  381. [1] Ron Daniel and Michael Mealling, "Resolution of Uniform Resource
  382.     Identifiers using the Domain Name System", draft-ietf-urn-naptr-01.txt,
  383.     November, 1996.
  384.  
  385. [2] RFC 1945, "Hypertext Transfer Protocol -- HTTP/1.0", T. Berners-Lee,
  386.     R. Fielding, H. Frystyk, May 1996.
  387.  
  388. [3] R. Fielding, J. Gettys, J.C. Mogul, H. Frystyk, T. Berners-Lee,
  389.     "Hypertext Transfer Protocol -- HTTP/1.1", draft-ietf-http-v11-spec-06,
  390.     July 1996.
  391.  
  392. [4] R. Moats, "URN Syntax", draft-ietf-urn-syntax-02, Jan. 1997.
  393.  
  394. [5] URN Resolution Services Draft -  (That document is in preparation.
  395.     It will actually be strongly based on the content of this document and
  396.     the NAPTR draft[1]). 
  397.  
  398. [6] RFC 1630, "Universal Resource Identifiers in WWW: A Unifying Syntax for
  399.     the Expression of Names and Addresses of Objects on the Network as
  400.     used in the World-Wide Web", T. Berners-Lee, June 1994.
  401.  
  402.  
  403. Security Considerations
  404. =======================
  405.   Communications with a resolver may be of a sensitive nature. Some
  406.   resolvers will hold information that should only be released to
  407.   authorized users. The results from resolvers may be the target of
  408.   spoofing, especially once electronic commerce transactions are common
  409.   and there is money to be made by directing users to pirate repositories
  410.   rather than repositories which pay royalties to rightsholders. Resolution
  411.   requests may be of interest to traffic analysts. The requests may also
  412.   be subject to spoofing.
  413.  
  414.   The requests and responses in this draft are amenable to encoding,
  415.   signing, and authentication in the manner of any other HTTP traffic.
  416.  
  417.  
  418. Author Contact Information:
  419. ===========================
  420.  
  421. Ron Daniel
  422. Advanced Computing Lab, MS B287
  423. Los Alamos National Laboratory
  424. Los Alamos, NM, USA, 87545
  425. voice:  +1 505 665 0597
  426. fax:    +1 505 665 4939
  427. email:  rdaniel@lanl.gov
  428.  
  429.  
  430.     This draft expires 21 July, 1997.
  431. Ron Daniel Jr.                   email: rdaniel@acl.lanl.gov
  432. Advanced Computing Lab, MS B287  voice: (505) 665-0597
  433. Los Alamos National Laboratory     fax: (505) 665-4939
  434. Los Alamos, NM, USA 87545         http://www.acl.lanl.gov/~rdaniel/
  435. Want to buy: "The Five Laws of Library Science" by S.R. Ranganathan